Parches esenciales para grupo funcional de bosque


Parches esenciales para grupo funcional de bosque…

---
title: "Parches esenciales e importantes para grupo funcional de bosque"
output: 
  flexdashboard::flex_dashboard:
    storyboard: true
    social: menu
    source: embed
---

```{r setup, include=FALSE}
#-------------------- Paquetes --------------------

library(flexdashboard)
library(dplyr)
library(sf)
library(leaflet)
library(esri2sf)

#----------------------- URL ----------------------

# URL del ArcGIS REST Feature Service
url_agfs_parches <-
  "https://services9.arcgis.com/RrvMEynxDB8hycVO/arcgis/rest/services/parches_esenciales_importantes_bosque_corredores/FeatureServer/0"

#---------------------- Datos ---------------------

# Objeto sf de parches
sf_parches = esri2sf(url_agfs_parches)

#---------------- Paleta de colores ---------------

pal <- colorNumeric(c("blue", "green", "red"), sf_parches$d_PC)
```

### Parches esenciales para grupo funcional de bosque

```{r}
leaflet(data = sf_parches) %>%
  setView(-84, 9.95, 11) %>%
  addProviderTiles(providers$OpenStreetMap.Mapnik, group = "OpenStreetMap") %>%
  addProviderTiles(providers$Stamen, group = "Stamen") %>%
  addProviderTiles(providers$Esri.WorldImagery, group = "Imágenes de ESRI") %>%
  addPolygons(
    fillOpacity = 0.9,
    stroke = TRUE,
    color = ~pal(d_PC),
    fillColor = ~pal(d_PC),
    weight = 0.3,
    smoothFactor = 0.2
  ) %>%
  addLayersControl(
    baseGroups = c("OpenStreetMap", "Stamen", "Imágenes de ESRI"),
    overlayGroups = c("Parches"),
    options = layersControlOptions(collapsed = TRUE)    
  ) %>%  
  addLegend(
    position = "bottomright",
    pal=pal,
    values = ~d_PC, 
    group = "Parches",
    title = "Esencialidad"
  ) %>%  
  addMiniMap(
    toggleDisplay = TRUE,
    position = "bottomleft",
    tiles = providers$OpenStreetMap.Mapnik
  ) %>%
  addScaleBar(
    position = "bottomright",
    options = scaleBarOptions(imperial = FALSE)
  )
```

***
Parches esenciales para grupo funcional de bosque...